package lib.wzh.com.libcore.framework.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Author lib
 * @Date 2021/11/23 16:02
 * @ClassName BaseEntity
 * @Version v1.0
 */
@Data
public class BaseEntity implements Serializable {

    @ApiModelProperty("租户")
    @TableField(fill = FieldFill.INSERT)
    private String tenantId;

    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createDate;

    @ApiModelProperty("更新人")
    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateDate;

    @ApiModelProperty("逻辑删除 1:正常,0:删除")
    @TableLogic()
    private Integer deleteFlag;

    @ApiModelProperty("版本号")
    @Version()
    private Integer version;

}
